package com.google.code.swingonfire.showcase.component.button;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JPanel;

import com.google.code.swingonfire.border.ShadowBorder;
import com.google.code.swingonfire.component.JBorderPanel;
import com.google.code.swingonfire.component.button.JMultiButton;
import com.google.code.swingonfire.layout.GBC;
import com.google.code.swingonfire.showcase.TitlePanel;

import static com.google.code.swingonfire.builder.JComponentBuilders.*;

public class JMultiButtonShowcase extends JPanel
{

    private static final long serialVersionUID = -2206822028563237612L;

    public JMultiButtonShowcase()
    {
        super(new BorderLayout());

        JPanel panel = panelBuilder().layout(new GridBagLayout()).build();
        panel.setBackground(Color.WHITE);
        panel.setOpaque(true);

        Action a = new AbstractAction("Action A")
        {
            
            @Override
            public void actionPerformed(ActionEvent e)
            {
                // TODO Auto-generated method stub
                
            }
        };
        JMultiButton b = new JMultiButton();
        b.addAction(a);
        
        GBC gbc = new GBC(1, 5);

        panel.add(b, gbc);

        add(new JBorderPanel(new TitlePanel("Button", "A utility class for Windows and Frames"), ShadowBorder.create()),
            BorderLayout.NORTH);
        add(new JBorderPanel(panel, ShadowBorder.create()), BorderLayout.CENTER);
    }

}
